'''
 * @ author     ：廖传港
 * @ date       ：Created in 2020/11/5 20:53
 * @ description：
 * @ modified By：
 * @ ersion     : 
 * @File        : test.py 
'''
import joblib
import numpy as np
from com.lcg.version11 import model
from com.lcg.version11 import Loading_pictures as lp

# dnn = joblib.load("D:/python/data/model/model1.model")  # 加载模型
# dnn = joblib.load("D:/python/data/model/model2.model")  # 加载模型
dnn = joblib.load("D:/python/data/model/model3.model")  # 加载模型

# 加载数据集
A, B = lp.loaddata("D:/python/data/testdata")
predictB = dnn.BatchPredict(A)

print("predictB=", predictB)
predictBB = np.array([np.argmax(one_hot) for one_hot in predictB])
print("predictBB=", predictBB)
realB = B
print("realB",realB)
realBB = np.array([np.argmax(one_hot) for one_hot in realB])
print("realBB", realBB)
from sklearn.metrics import accuracy_score

# accuracy_score(predictYY, realYY)

print("准确数=",accuracy_score(predictBB, realBB, normalize=False))
print("准确率=",accuracy_score(predictBB, realBB))